<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <title-age :str='name' :age='age'></title-age>
    <name-age :uname='uname' :uage='uage'>
    </name-age>
  </div>
  <script src="../vue.js"></script>
  <script>
    Vue.component('name-age', {
      props: ['uname', 'uage'],
      template: `
        <div>
          <p>{{uname}}</p>
          <p>{{uage}}</p>

        </div>
      `
    })


    Vue.component('title-age', {
      props: ['str', 'age'],

      template: `
        <div>
          <p>{{str}}</p>
          <p>{{age}}</p>
        </div>
      `
    })

    var vm = new Vue({
      el: '#app',
      data: {
        name: '吾乃常山赵子龙',
        age: 28,
        uname: '古之恶来 典韦',
        uage: 30
      },
    })
  </script>
</body>

</html>